package com.front.peikuahaitao.presenter;

import com.front.peikuahaitao.base.BaseFragment;
import com.front.peikuahaitao.base.BasePresenter;
import com.front.peikuahaitao.model.LoginModel;
import com.front.peikuahaitao.model.OnLoginListener;
import com.front.peikuahaitao.view.impl.ILoginView;

/**
 * Created by Administrator on 2016/7/20.
 */
public class LoginPresenter extends BasePresenter<ILoginView> {
    private ILoginView iLoginView ;
    private LoginModel loginModel;
    public LoginPresenter(ILoginView iLoginView) {
        loginModel = new LoginModel();
        this.iLoginView = iLoginView;
    }

    public void userLogin(String userName,String passWord){
        loginModel.getData(userName, passWord, new OnLoginListener() {

            @Override
            public void onSuccess(String userName) {
                iLoginView.onSuccess(userName);
            }

            @Override
            public void onFail(String passWord) {
                iLoginView.onFail(passWord);
            }
        });
    }
}
